home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993 April: Penguin on DISC / ADC Developer CD (1993-04) (''Penguin On DISC'')_iso / Dev.CD Apr 93.iso / Utilities / MPW Interfaces 7.1 Beta / CIncludes / EPPC.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-28  |  3.1 KB  |  137 lines  |  [TEXT/MPS ]

  1.  
  2. /************************************************************
  3.  
  4. Created: Saturday, July 27, 1991 at 3:08 PM
  5.  EPPC.h
  6.  C Interface to the Macintosh Libraries
  7.  
  8.  
  9.   Copyright Apple Computer, Inc. 1988-1991
  10.   All rights reserved
  11.  
  12. *** Warning: This is an alpha version of the Interfaces for Cube-E. 
  13. ***          Things may change.  Caveat Programmer.
  14.  
  15.  
  16. */
  17.  
  18.  
  19. #ifndef __EPPC__
  20. #define __EPPC__
  21.  
  22. #ifndef __PPCTOOLBOX__
  23. #include <PPCToolbox.h>
  24. #endif
  25.  
  26. #ifndef __PROCESSES__
  27. #include <Processes.h>
  28. #endif
  29.  
  30. #ifndef __EVENTS__
  31. #include <Events.h>
  32. #endif
  33.  
  34.  
  35. enum {
  36.  
  37.  kHighLevelEvent = 23,
  38.  
  39. /* postOptions currently supported */
  40.  receiverIDMask = 0x0000F000,
  41.  receiverIDisPSN = 0x00008000,
  42.  receiverIDisSignature = 0x00007000,
  43.  receiverIDisSessionID = 0x00006000,
  44.  receiverIDisTargetID = 0x00005000,
  45.  
  46.  systemOptionsMask = 0x00000F00,
  47.  nReturnReceipt = 0x00000200,
  48.  
  49.  priorityMask = 0x000000FF,
  50.  nAttnMsg = 0x00000001,
  51.  
  52.  
  53. /* error returns from Post and Accept */
  54.  
  55.  bufferIsSmall = -607,
  56.  noOutstandingHLE = -608,
  57.  connectionInvalid = -609,
  58.  noUserInteractionAllowed = -610,    /* no user interaction allowed */
  59.  
  60. /* constant for return receipts */
  61.  
  62.  
  63. #define HighLevelEventMsgClass 'jaym'
  64. #define rtrnReceiptMsgID 'rtrn'
  65.  
  66.  msgWasPartiallyAccepted = 2,
  67.  msgWasFullyAccepted = 1,
  68.  msgWasNotAccepted = 0
  69. };
  70.  
  71. struct TargetID {
  72.  long sessionID;
  73.  PPCPortRec name;
  74.  LocationNameRec location;
  75.  PPCPortRec recvrName;
  76. };
  77.  
  78. typedef struct TargetID TargetID;
  79. typedef TargetID *TargetIDPtr, **TargetIDHdl;
  80.  
  81.  
  82. typedef TargetID SenderID;
  83. typedef SenderID *SenderIDPtr;
  84.  
  85. struct HighLevelEventMsg {
  86.  unsigned short HighLevelEventMsgHeaderLength;
  87.  unsigned short version;
  88.  unsigned long reserved1;
  89.  EventRecord theMsgEvent;
  90.  unsigned long userRefcon;
  91.  unsigned long postingOptions;
  92.  unsigned long msgLength;
  93. };
  94.  
  95. typedef struct HighLevelEventMsg HighLevelEventMsg;
  96. typedef HighLevelEventMsg *HighLevelEventMsgPtr, **HighLevelEventMsgHdl;
  97.  
  98.  
  99. #ifdef __cplusplus
  100. extern "C" {
  101. #endif
  102. pascal OSErr PostHighLevelEvent(const EventRecord *theEvent,
  103.                                 unsigned long receiverID,
  104.                                 unsigned long msgRefcon,
  105.                                 Ptr msgBuff,
  106.                                 unsigned long msgLen,
  107.                                 unsigned long postingOptions)
  108.  = {0x3F3C,0x0034,0xA88F}; 
  109. pascal OSErr AcceptHighLevelEvent(TargetID *sender,
  110.                                   unsigned long *msgRefcon,
  111.                                   Ptr msgBuff,
  112.                                   unsigned long *msgLen)
  113.  = {0x3F3C,0x0033,0xA88F}; 
  114. pascal OSErr GetProcessSerialNumberFromPortName(const PPCPortPtr portName,
  115.  ProcessSerialNumberPtr pPSN)
  116.  = {0x3F3C,0x0035,0xA88F}; 
  117. pascal OSErr GetPortNameFromProcessSerialNumber(PPCPortPtr portName,const ProcessSerialNumberPtr pPSN)
  118.  = {0x3F3C,0x0046,0xA88F}; 
  119. #ifdef __cplusplus
  120. }
  121. #endif
  122. typedef pascal Boolean (*GetSpecificFilterProcPtr) (void *yourDataPtr,
  123.   HighLevelEventMsgPtr msgBuff,
  124.   const TargetID *sender);
  125.  
  126. #ifdef __cplusplus
  127. extern "C" {
  128. #endif
  129. pascal Boolean GetSpecificHighLevelEvent(GetSpecificFilterProcPtr aFilter,
  130.  void *yourDataPtr,OSErr *err)
  131.  = {0x3F3C,0x0045,0xA88F}; 
  132. #ifdef __cplusplus
  133. }
  134. #endif
  135.  
  136. #endif
  137.